package com.kadron.enumeration;

import org.jboss.seam.core.Interpolator;

import com.kadron.common.KInitParams;

/**
 * This is ENUM class representing user types.
 * <ul>
 * <li>
 * STANDARD - Standard User without any discount</li>
 * <li>
 * STANDARD_1 - 10% first buy, in next 10 days, 5% first buy in 10+ days</li>
 * <li>
 * STANDARD_10 - 10% for a Month</li>
 * <li>
 * SILVER - 20+ KADRONS, {@link KInitParams#SILVER_DISCOUNT}% for 
 * {@link KInitParams#SILVER_DURATION}</li>
 * <li>
 * GOLD - 100+ KADRONS, {@link KInitParams#GOLD_DISCOUNT}% for 
 * {@link KInitParams#GOLD_DURATION}</li>
 * <li>
 * PLATINUM - 200+ KADRONS, {@link KInitParams#PLATINUM_DISCOUNT}% for 
 * {@link KInitParams#PLATINUM_DURATION}</li>
 * </ul>
 * 
 * @author kadron
 * 
 */
public enum UserType {

	STANDARD(0),
	STANDARD_FIST_BUY(1),//10% first buy, in next 10 days, 5% first buy in 10+ days
	STANDARD_10(2),// 10% for a Month
	SILVER(3),// 20+ KADRONS, X% for one year
	GOLD(4),// 100+ KADRONS, Y% for one year
	PLATINUM(5); // 200+ KADRONS, Z% for one year
	
	private int ordinal;

	private UserType(int ordinal) {
		this.ordinal = ordinal;
	}

	public int getOrdinal() {
		return ordinal;
	}

	public void setOrdinal(int ordinal) {
		this.ordinal = ordinal;
	}
	
	public String getMessage() {
		return Interpolator.instance().interpolate("#{messages['"+name()+"_MSG']", new Object());
	}
	
}